package action.user;

import persistence.model.TdfkfaDeclareUnit;
import service.UnitService;

import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;

public class AddUnitSubmitAction extends ActionSupport {

    private static final long serialVersionUID = 1L;

    private UnitService unitService;

    private TdfkfaDeclareUnit unit;

    private String optRet;

    public String execute() throws Exception {

        optRet = unitService.saveUnit(unit);
        return Action.SUCCESS;
    }

    public TdfkfaDeclareUnit getUnit() {
        return unit;
    }

    public void setUnit(TdfkfaDeclareUnit unit) {
        this.unit = unit;
    }

    public void setUnitService(UnitService unitService) {
        this.unitService = unitService;
    }

    public String getOptRet() {
        return optRet;
    }

}
